package com.elai.baseconfig.service.impl;

import java.util.List;
import com.elai.common.utils.DateUtils;
import com.elai.common.utils.SecurityUtils;
import com.elai.system.service.ISysConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.elai.baseconfig.mapper.BaseApplicationInfoMapper;
import com.elai.baseconfig.domain.BaseApplicationInfoDO;
import com.elai.baseconfig.service.BaseApplicationInfoService;

/**
 * 应用管理Service业务层处理
 *
 * @author elai
 * @date 2021-07-03
 */
@Service
public class BaseApplicationInfoServiceImpl implements BaseApplicationInfoService
{
    @Autowired
    private BaseApplicationInfoMapper baseApplicationInfoMapper;

    @Autowired
    private ISysConfigService configService;
    /**
     * 查询应用管理
     *
     * @param id 应用管理ID
     * @return 应用管理
     */
    @Override
    public BaseApplicationInfoDO selectBaseApplicationInfoById(Long id)
    {
        return baseApplicationInfoMapper.selectBaseApplicationInfoById(id);
    }

    /**
     * 查询应用管理列表
     *
     * @param baseApplicationInfo 应用管理
     * @return 应用管理
     */
    @Override
    public List<BaseApplicationInfoDO> selectBaseApplicationInfoList(BaseApplicationInfoDO baseApplicationInfo)
    {
        return baseApplicationInfoMapper.selectBaseApplicationInfoList(baseApplicationInfo);
    }

    /**
     * 新增应用管理
     *
     * @param baseApplicationInfo 应用管理
     * @return 结果
     */
    @Override
    public int insertBaseApplicationInfo(BaseApplicationInfoDO baseApplicationInfo)
    {
        baseApplicationInfo.setCreateTime(DateUtils.getNowDate());
        baseApplicationInfo.setUpdateBy(SecurityUtils.getUsername());
        baseApplicationInfo.setUpdateTime(DateUtils.getNowDate());
        return baseApplicationInfoMapper.insertBaseApplicationInfo(baseApplicationInfo);
    }

    /**
     * 修改应用管理
     *
     * @param baseApplicationInfo 应用管理
     * @return 结果
     */
    @Override
    public int updateBaseApplicationInfo(BaseApplicationInfoDO baseApplicationInfo)
    {
        baseApplicationInfo.setUpdateTime(DateUtils.getNowDate());
        return baseApplicationInfoMapper.updateBaseApplicationInfo(baseApplicationInfo);
    }

    /**
     * 批量删除应用管理
     *
     * @param ids 需要删除的应用管理ID
     * @return 结果
     */
    @Override
    public int deleteBaseApplicationInfoByIds(Long[] ids)
    {
        return baseApplicationInfoMapper.deleteBaseApplicationInfoByIds(ids);
    }

    /**
     * 删除应用管理信息
     *
     * @param id 应用管理ID
     * @return 结果
     */
    @Override
    public int deleteBaseApplicationInfoById(Long id)
    {
        return baseApplicationInfoMapper.deleteBaseApplicationInfoById(id);
    }
}
